home *** CD-ROM | disk | FTP | other *** search
/ Eagles Nest BBS 5 / Eagles_Nest_Mac_Collection_Disc_5.TOAST / Science & Religion / AdvHamOpTest / Advanced Ham Test V1 / background_2725.txt < prev    next >
Text File  |  1990-11-03  |  7KB  |  221 lines

  1. -- background: 2725 from stack: in
  2. -- bmap block id: 3199
  3. -- flags: 4000
  4. -- background id: 0
  5. -- name: intro
  6. ----- HyperTalk script -----
  7. on buildList -- ‚Ä¢‚Ä¢‚Ä¢ rename to buildList1 if using sequential questions
  8.   -- or to buildList if using randomly-generated questions
  9.   global questlist,rightone,lockkey,questans,questkey
  10.   -- initialization
  11.   set the cursor to 4
  12.   -- ‚Ä¢‚Ä¢‚Ä¢questgrp contains the number of questions in each question group
  13.   -- and is used to generate random questions, one from each group.
  14.   -- Note that the question groups MUST BE sequential in order for this
  15.   -- to work.  That is, group 1 must be the first 10 questions, group 2
  16.   -- must be the next 14 questions, and so on.
  17.   put "11,11,11,9,12,12,10,10,10,11," into questgrp
  18.   put "10,7,12,12,11,10,10,10,10,10," after questgrp
  19.   put "7,10,10,10,10,10,10,10,10,10," after questgrp
  20.   put "9,11,11,9,11,13,9,7,10,10," after questgrp
  21.   put "10,10,12,10,11,10,9,9,10,10" after questgrp
  22.   -- ‚Ä¢‚Ä¢‚Ä¢ The number of commas in questans and questkey must be equal to
  23.   -- number of questions in each test minus one.  For example, for a
  24.   -- 50-question test, there are 49 commas.
  25.   put ",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,," into questans
  26.   put ",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,," into questkey
  27.   put empty into questlist
  28.   put 0 into startgroup
  29.   put empty into ky1
  30.   put empty into ky2
  31.   put empty into ky3
  32.   put empty into ky4
  33.   put empty into ky5
  34.   put empty into ky6
  35.   set lockscreen to true
  36.   -- generate the questions from subgroups randomly
  37.   repeat with i = 1 to number of items of questgrp
  38.     put startgroup into thisquest
  39.     add the random of item i of questgrp to thisquest
  40.     put questlist & "#" & thisquest & "," into questlist
  41.     add item i of questgrp to startgroup
  42.   end repeat
  43.   delete last character of questlist
  44.   -- ‚Ä¢‚Ä¢‚Ä¢ generate the answer key for these questions.  this currently
  45.   -- only handles up to first 51 questions.
  46.   repeat with i = 1 to number of items of questlist
  47.     if i > 51 then exit repeat
  48.     put item i of questlist into thisquest
  49.     go to card thisquest
  50.     -- ‚Ä¢‚Ä¢‚Ä¢ You can put the card # or the subelement #  or question #
  51.     -- as question #in key
  52.     put "#" & i into x -- question # option
  53.     -- put the short name of this card into x -- card # option
  54.     -- put first word of field "Q1" into x -- subelement # option
  55.     if i < 18 then
  56.       put ky1&x&return into ky1
  57.       put ky2&rightone&return into ky2
  58.     else if i < 35 then
  59.       put ky3&x&return into ky3
  60.       put ky4&rightone&return into ky4
  61.     else
  62.       put ky5&x&return into ky5
  63.       put ky6&rightone&return into ky6
  64.     end if
  65.   end repeat
  66.   go to card K
  67.   put ky1 into field key1
  68.   put ky2 into field key2
  69.   put ky3 into field key3
  70.   put ky4 into field key4
  71.   put ky5 into field key5
  72.   put ky6 into field key6
  73.   -- prevent buildList from being called again immediately
  74.   put true into lockkey
  75.   go to first card
  76.   set lockscreen to false
  77. end buildList
  78.  
  79. on buildList1 -- ‚Ä¢‚Ä¢‚Ä¢ rename to buildList for sequential questions or to
  80.   -- buildList1 for randomly-generated questions
  81.   global questlist,rightone,lockkey,questans,questkey
  82.   -- initialization
  83.   set the cursor to 4
  84.   -- ‚Ä¢‚Ä¢‚Ä¢ be sure that the group number of each question card matches the
  85.   -- question number.  For example, question #1 is group 1, question
  86.   -- #2 is group 2, and so on.
  87.   put empty into questlist
  88.   put empty into questans
  89.   put empty into questkey
  90.   put empty into ky1
  91.   put empty into ky2
  92.   put empty into ky3
  93.   put empty into ky4
  94.   set lockscreen to true
  95.   repeat with i = 1 to number of cards of bkgnd Test
  96.     put "#" & i & "," after questlist
  97.     put "," after questans
  98.     put "," after questkey
  99.   end repeat
  100.   delete last character of questlist
  101.   delete last character of questans
  102.   delete last character of questkey
  103.   -- ‚Ä¢‚Ä¢‚Ä¢ generate the answer key for these questions.  This currently
  104.   -- only works for first 32 questions
  105.   repeat with i = 1 to number of items of questlist
  106.     if i > 32 then exit repeat
  107.     put item i of questlist into thisquest
  108.     go to card thisquest
  109.     -- You can put the card # or the subelement # as question #in key
  110.     put the short name of this card into x
  111.     -- put first word of field "Q1" into x
  112.     if i < 17 then
  113.       put ky1&x&return into ky1
  114.       put ky2&rightone&return into ky2
  115.     else
  116.       put ky3&x&return into ky3
  117.       put ky4&rightone&return into ky4
  118.     end if
  119.   end repeat
  120.   go to card K
  121.   put ky1 into field key1
  122.   put ky2 into field key2
  123.   put ky3 into field key3
  124.   put ky4 into field key4
  125.   -- prevent buildList from being called again immediately
  126.   put true into lockkey
  127.   go to first card
  128.   set lockscreen to false
  129. end buildList1
  130.  
  131.  
  132.  
  133.  
  134. -- part 1 (button)
  135. -- low flags: 00
  136. -- high flags: 0000
  137. -- rect: left=111 top=169 right=309 bottom=228
  138. -- title width / last selected line: 0
  139. -- icon id / first selected line: 0 / 0
  140. -- text alignment: 1
  141. -- font id: 0
  142. -- text size: 12
  143. -- style flags: 0
  144. -- line height: 16
  145. -- part name: Exam
  146. ----- HyperTalk script -----
  147. on mouseDown
  148.   ask "Please enter your name."
  149.   put it into field "user" of card id 11003
  150.   -- ‚Ä¢‚Ä¢‚Ä¢ change unlimited to # minutes to put a time limit on test
  151.   -- be sure to change background of questions and below also.
  152.   answer "You have unlimited minutes to take this test" with "OK"
  153. end mouseDown
  154.  
  155. on mouseUp
  156.   global time1,score,check2,ok,questlist
  157.   set the cursor to 4
  158.   put empty into ok
  159.   put empty into score
  160.   put empty into check2
  161.   put empty into field id 6 of card id 11003
  162.   get the long time
  163.   put it into field "Start" of Card "Report"
  164.   convert it to seconds
  165.   -- ‚Ä¢‚Ä¢‚Ä¢ change 30 in next line to # of minutes desired for time limit
  166.   add 30*60 to it
  167.   put it into time1
  168.   -- put questlist into message -- for debug only
  169.   visual effect dissolve to black
  170.   visual effect dissolve
  171.   -- go card "#1" -- for debug only
  172.   get item 1 of questlist
  173.   go card it
  174. end mouseUp
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182. -- part 2 (button)
  183. -- low flags: 00
  184. -- high flags: 0000
  185. -- rect: left=27 top=47 right=85 bottom=71
  186. -- title width / last selected line: 0
  187. -- icon id / first selected line: 1011 / 1011
  188. -- text alignment: 1
  189. -- font id: 0
  190. -- text size: 12
  191. -- style flags: 0
  192. -- line height: 16
  193. -- part name: Home
  194. ----- HyperTalk script -----
  195. on mouseUp
  196.   visual effect iris close
  197.   go home
  198. end mouseUp
  199.  
  200.  
  201.  
  202.  
  203. -- part 4 (button)
  204. -- low flags: 00
  205. -- high flags: 0000
  206. -- rect: left=431 top=55 right=94 bottom=472
  207. -- title width / last selected line: 0
  208. -- icon id / first selected line: 14767 / 14767
  209. -- text alignment: 1
  210. -- font id: 0
  211. -- text size: 12
  212. -- style flags: 0
  213. -- line height: 16
  214. -- part name: Tell Me About...
  215. ----- HyperTalk script -----
  216. on mouseUp
  217.   push this card
  218.   visual effect iris open
  219.   go to card "About...."
  220. end mouseUp
  221.